<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->

<link type="text/css" rel="stylesheet" href="__ROOT__/Public/web/js/uploadify/uploadify.css" media="all">
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/static/h-ui.admin/css/style.css" />
<link href="__ROOT__/Public/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<title>新增文章 - 资讯管理 - H-ui.admin v2.3</title>
<meta name="keywords" content="H-ui.admin v2.3,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 门店管理 <span class="c-gray en">&gt;</span> 门店添加 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
	<form class="form form-horizontal" name="form1" enctype='multipart/form-data' method="post" action="{:U('Store/storeAdd')}" >
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请输入门店名称" id="" name="title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商品品牌类型：</label>
			<div class="formControls col-xs-8 col-sm-9"> 
				<span class="select-box">
					<select name="type"  id="brand"   class="select">
						<option value="1">喜梦宝</option>
						<option value="2">英伦印象</option>
					</select>
				</span> 
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店经度：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" readonly value="" placeholder="点击地图获取门店经纬度" id="" name="lng">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店纬度：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" readonly value="" placeholder="点击地图获取门店经纬度" id="" name="lat">
			</div>
		</div>
		<div style="margin-left:200px;margin-top:10px;width:880px;height:300px" id="allmap"></div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店联系方式：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请输入门店联系方式" id="" name="mobile">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店所在城市：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div class="fendizhi float_l" id="city">
					<select class="prov" name="sheng" id="mensheng"></select> 
					<select class="city " disabled="disabled" name="shi" id="menshi"></select>
					<select class="dist" disabled="disabled" name="xian" id="menxian"></select>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店详细地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请输入门店详细地址" id="title" name="content">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店概况大图：</label>
			<div class="tusc_box fl" style="float:left;">
              <div class="tusc_page">
                <div class="sc_btn1 fl">
				<div class="upload-area">
				<input type="file" name="fileurl" id="file_upload1">
				</div>
				</div>
              </div>
			  <div id="filename1"></div>                
              <div class="sctishi fl"><span class="c-red">*</span>支持jpg/png/gif/jpeg,建议1340 X 618px</div>                 
            </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2" style="float:left;"><span class="c-red">*</span>门店详情小图：</label>
			<div class="tusc_box fl" style="float:left;">
              <div class="tusc_page">
                <div class="sc_btn1 fl">
				<div class="upload-area">
				<input type="file" name="fileurl" id="file_upload">
				</div>
				</div>
              </div>
			  <div id="filename"></div>                
              <div class="sctishi fl"><span class="c-red">*</span>支持jpg/png/gif/jpeg,建议225 X 155px</div>                 
            </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>门店描述：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="description"  cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！"></textarea>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
			<button onClick="return check();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__ROOT__/Public/lib/jquery/1.9.1/jquery.min.js"></script>
<script charset="utf-8" src="__ROOT__/Public/web/js/uploadify/jquery.uploadify.min.js"></script>
<script charset="utf-8" src="__PUBLIC__/web/js/jquery.cityselect.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=BC0a4ab08f416e1d2be9994fd525a4c0"></script>
<script type="text/javascript">
$(function(){
  $("#city").citySelect({
    prov:'福建',
    city:'厦门',
    dist:'思明区',
      nodata:"none"
  });
});
</script>
<script type="text/javascript">
	var img_id_upload=new Array();//初始化数组，存储已经上传的图片名
	var i=0;//初始化数组下标
	var uploadLimit=6;
	$(function() {
		
	    $('#file_upload').uploadify({
	    	'auto'     : true,//关闭自动上传
	    	'removeTimeout' : 0.5,//文件队列上传完成0.5秒后删除
	        'swf'      : '__ROOT__/Public/web/js/uploadify/uploadify.swf',
			'fileObjName':'fileurl',
	        'uploader' : '{:U("Pic/uploadify")}',
	        'method'   : 'post',          //方法，服务端可以用$_POST数组获取数据
	        'buttonText' : '选择图片',//设置按钮文本
	        'multi'    : true,//允许同时上传多个
			'fileTypeDesc' : 'Image Files',//只允许上传图像
			'fileTypeExts' : '*.gif; *.jpg; *.png; *.jpeg',//限制允许上传的图片后缀
	        'uploadLimit' : uploadLimit,//一次最多只允许上传
	        'fileSizeLimit' : '3MB',//限制上传大小
			'width' 		: '70',  //@fanboo
			'height' 		: '30',  //@fanboo		
			//返回一个错误，选择文件的时候触发
			'onSelectError': function (file, errorCode, errorMsg) {
				switch (errorCode) {
					case -100:
						alert("上传的文件数量已经超出系统限制的6个文件！");
						return false;
					case -110:
						alert("文件 [" + file.name + "] 大小超出系统限制的" + $('#file_upload').uploadify('settings', 'fileSizeLimit') + "大小！");
						return false;
				}
			},
	        'onUploadSuccess' : function(file, data, response) { //每次成功上传后执行的回调函数，从服务端返回数据到前端
				var str = "<div style='float:left;padding-top:10px'><input name='imgurl[]' type='hidden' value='"+data+"'><img style='margin-left:10px' class='pic' src='"+data+"'  width='100' height='100'><img class='delete' style='margin-top: -80px;' onclick='djxs(this)' title='点击删除' src='/Public/admin/images/tubiao_delete.png' width='14' height='14'></div>";
				$("#filename").append(str);					
	        },

	    });
	});
	function djxs(o){
		uploadLimit=uploadLimit+1;
		var num=$('#file_upload').uploadify('settings','uploadLimit', uploadLimit);
		$(o).parent().remove();
	}
	function check(){
		var title = $("input[name='title']").val();
		var type = $("select[name='type']").val();
		var mobile = $("input[name='mobile']").val();
		var lng = $("input[name='lng']").val();
		var lat = $("input[name='lat']").val();
		var content = $("input[name='content']").val();
		var sheng = $("select[name='sheng']").val();
		var shi = $("select[name='shi']").val();
		var xian = $("select[name='xian']").val();
		var description = $("textarea[name='description']").val();
		var len = $("#filename").find("input").length;
		var len1 = $("#filename1").find("input").length;
		if(title == ""){
			alert('请输入门店名称');
			return false;
		}
		if(type == ""){
			alert('请选择门店品牌');
			return false;
		}
		if(lng == ""){
			alert('请输入点击地图获取门店经度');
			return false;
		}
		if(lat == ""){
			alert('请输入点击地图获取门店纬度');
			return false;
		}
		if(mobile == ""){
			alert('请输入门店联系方式');
			return false;
		}
		if(!(/^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/.test(mobile))){
			alert('请输入正确的手机号');
			return false;
		}
		if(content == ""){
			alert('请输入门店详细地址');
			return false;
		}
		if(len1 <= 0){
			alert("请选择要上传的门店概况大图");
			return false;
		}
		if(len <= 0){
			alert("请选择要上传的门店详情小图");
			return false;
		}
		if(description == ""){
			alert('请输入门店描述');
			return false;
		}
	}
</script>
<script type="text/javascript">
	// 百度地图API功能
	var map = new BMap.Map("allmap");
	setMapEvent();//设置地图事件
	map.centerAndZoom(new BMap.Point(118.135646, 24.499248), 11);
	function showInfo(e){
		$("input[name='lng']").val(e.point.lng);
		$("input[name='lat']").val(e.point.lat);
	}
	map.addEventListener("click", showInfo);
	function setMapEvent(){
      map.enableScrollWheelZoom();
      map.enableKeyboard();
      map.enableDragging();
    }
</script>
<script type="text/javascript">
	img_id_upload=new Array();//初始化数组，存储已经上传的图片名
	var uploadLimit2=1;
	$(function() {
		
	    $('#file_upload1').uploadify({
	    	'auto'     : true,//关闭自动上传
	    	'removeTimeout' : 0.5,//文件队列上传完成0.5秒后删除
	        'swf'      : '__ROOT__/Public/web/js/uploadify/uploadify.swf',
			'fileObjName':'fileurl',
	        'uploader' : '{:U("Pic/uploadify")}',
	        'method'   : 'post',          //方法，服务端可以用$_POST数组获取数据
	        'buttonText' : '选择图片',//设置按钮文本
	        'multi'    : true,//允许同时上传多个
			'fileTypeDesc' : 'Image Files',//只允许上传图像
			'fileTypeExts' : '*.gif; *.jpg; *.png; *.jpeg',//限制允许上传的图片后缀
	        'uploadLimit' : uploadLimit2,//一次最多只允许上传
	        'fileSizeLimit' : '3MB',//限制上传大小
			'width' 		: '70',  //@fanboo
			'height' 		: '30',  //@fanboo		
			//返回一个错误，选择文件的时候触发
			'onSelectError': function (file, errorCode, errorMsg) {
				switch (errorCode) {
					case -100:
						alert("上传的文件数量已经超出系统限制的1个文件！");
						return false;
					case -110:
						alert("文件 [" + file.name + "] 大小超出系统限制的" + $('#file_upload').uploadify('settings', 'fileSizeLimit') + "大小！");
						return false;
				}
			},
	        'onUploadSuccess' : function(file, data, response) { //每次成功上传后执行的回调函数，从服务端返回数据到前端
				var str = "<div style='float:left;padding-top:10px'><input name='imgurl1[]' type='hidden' value='"+data+"'><img style='margin-left:10px' class='pic' src='"+data+"'  width='100' height='100'><img style='margin-top: -80px;' class='delete' onclick='djxs2(this)' title='点击删除' src='/Public/admin/images/tubiao_delete.png' width='14' height='14'></div>";
				$("#filename1").append(str);					
	        },

	    });
	});
	function djxs2(o){
		uploadLimit2=uploadLimit2+1;
		var num=$('#file_upload1').uploadify('settings','uploadLimit2', uploadLimit2);
		$(o).parent().remove();
	}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>